package composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author liangliangzhao
 * @data 2023/4/12 17:58
 */

public class College extends OrganizationComponent{
    List<OrganizationComponent> organizationComponents = new ArrayList<OrganizationComponent>();
    public College(String name,String des){
        super(name,des);
    }
    @Override
    protected void add(OrganizationComponent organizationComponent) {
        organizationComponents.add(organizationComponent);
    }
    @Override
    protected void remove(OrganizationComponent organizationComponent) {
        organizationComponents.remove(organizationComponent);
    }
    @Override
    protected void print() {
        System.out.println("--------------------"+getName()+"--------------------");
        for (OrganizationComponent organizationComponent : organizationComponents) {
            organizationComponent.print();
        }
    }
}
